/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package templatemethod;

/**
 * @author shadow
 * @Date 2016年8月12日下午9:34:26
 * @Fun 模板方法(TemplateMethod)模式：行为型模式，定义了一系列操作的骨架，将模块的实现，延迟到实现类或者子类中进行。<br/>
 * 跟建造者模式的比较：<br/>
 * 建造者模式，使用组合方式，由指挥者Director指挥组合的Builder建造，建造流程由Director控制，建造的模块<br/>
 * 方法由Builder实现。<br/>
 * 模板方法模式，由模板定义操作流程，由子类或实现类实现具体的模块方法。<br/>
 * 综上，建造者模式灵活于模板方法模式。<br/>
 **/
public class MainTest {
    public static void main(String[] args) {
        BaseTemplate template = new TemplateMethod();
        template.useTemplateMethod();

        System.out.println();

        template = new TemplateMethod2();
        template.useTemplateMethod();
    }
}
/**
 * 推荐博客：http://blog.csdn.net/hguisu/article/details/7564039
 */
